<?php
require_once '../plugins/Zend/Loader.php';
class download {
	var $db;
 	var $smarty;	
	public function __construct($db, $smarty,$page='',$cat='',$product='') {
		$this->db = $db;
		$this->smarty = $smarty;
		$this->page = $page;
		$this->cat = $cat;
		$this->product = $product;
	}
	
	public function main() {
		
		
		//require_once 'Zend/Gdata/Docs.php';
		Zend_Loader::loadClass('Zend_Gdata');
		Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
		Zend_Loader::loadClass('Zend_Gdata_Docs');
		Zend_Loader::loadClass('Zend_Http_Client');	
	
		
		
		
		$service = Zend_Gdata_Docs::AUTH_SERVICE_NAME;
		$client = Zend_Gdata_ClientLogin::getHttpClient(GUSER, GPASS, $service);
		$gdClient = new Zend_Gdata_Docs($client);
	    $feed = $gdClient->getDocumentListFeed('https://docs.google.com/feeds/default/private/full?v=3');
		foreach ($feed as $item) {
			echo $item->getTitle()."<br>";
		}
		$this->smarty->display("download.tpl");	
	}
	
	
	
}
?>
